import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<>();
        while (sc.hasNextInt()) {
            list.add(sc.nextInt());
        }
        Collections.sort(list);
        int max = list.get(list.size() - 1);
        System.out.println("最大值 " + max);
        int big = max % 10;
        max /= 10;
        while (max > 0) {
            if (max % 10 > big)
                big = max % 10;
            max /= 10;
        }
        System.out.println("最大位 "+big);
    }
}
